<?php

	abstract class Devmod_castField_abstraction {
		
		protected $value = null;
		
		protected $cfg = null;
		
		protected $args = null;
		
		protected $config = array();
		
		protected $view = null;
		
		protected $db = null;
		
		protected $helper = null;
		
		protected $row_value = null;
		
		public $addons = array();
		
		public function __construct($value, $row_value, $cfg, $config, $view)
		{
			$this->value = $value; 
			
			$this->row_value = $row_value;
			
			$this->cfg = $cfg; 
			
			$this->args = $cfg['args']; 
			
			$this->config = $config; 
			
			$this->view = $view;
			
			$this->view->assign(array(
				'host' => SiteConfig::Domain,
				'theme' => "theme/" . Yomm_Config::VAR_BACKEND_THEME . "/"
			));
			
			if($this->view->template_dir !== "theme/". Yomm_Config::VAR_BACKEND_THEME . "/tpl/") {
				$this->view->template_dir = "share/tpl/"; // its an external theme, so set share/tpl/common folders
			}
			
			$this->db = ydsql::getInstance();
			
			$this->helper = new Devmod_helper();
		}
		
	}